<?
header("Content-type: text/html; charset=utf-8"); 
header("Cache-control: private");

if(!file_exists(ROOT_PATH.'NO_delete_webIM.environment.inc.php')) define('ENVIRONMENT','online');
else require_once(ROOT_PATH.'NO_delete_webIM.environment.inc.php');
if(!defined('ENVIRONMENT')) define('ENVIRONMENT','online');

if(ENVIRONMENT == 'online') {
	ini_set("display_errors",0);
	define('PATH_lOG',ROOT_PATH.'logs/');
	define('ERROR_LOG_FLOG',true);
	define('SQL_LOG_FLOG',false);	
	define('HOST_ROOT','http://cs.9wee.com/');
}

if(ENVIRONMENT == 'test') {
	ini_set("display_errors",1);
	define('PATH_lOG',ROOT_PATH.'logs/');
	define('ERROR_LOG_FLOG',true);
	define('SQL_LOG_FLOG',true);
	define('HOST_ROOT','http://localhost/partner/www/cs/');
}

if(HOST_ROOT=='') die('请设定HOST_ROOT');
require_once(ROOT_PATH.'code/bean/function.php');



//$_SERVER['HTTP_HOST'] = "game.9wee.com";//die("s=".$_SERVER['HTTP_HOST']);

if(isset($_GET['game_id'])) {
	setcookie('game_id',$_GET['game_id'],0,'/');
	$game_id=$_GET['game_id'];
}
else {
	if(!isset($_COOKIE['game_id'])) 
        $game_id = "";
	else $game_id=$_COOKIE['game_id'];
}

if(isset($_GET['server_id'])) {
	setcookie('server_id',$_GET['server_id'],0,'/');
	$server_id=$_GET['server_id'];
}
else {
	if(!isset($_COOKIE['server_id'])) 
        $server_id = '';
	else $server_id=$_COOKIE['server_id'];
}

?>